<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../jquery.min.js"></script>
    <style>
        div {
            width: 150px;
            height: 300px;
            background-color: pink;
            display: none;
        }
    </style>
</head>

<body>
    <button>下拉滑动</button>
    <button>上拉滑动</button>
    <button>切换滑动</button>
    <div></div>
    <script>
        $(function() {
            $('button').eq(0).click(function() {
                $('div').slideDown();
            })

            $('button').eq(1).click(function() {
                $('div').slideUp(500);
            })

            $('button').eq(2).click(function() {
                $('div').slideToggle(500, function() {
                    alert('切换完成');
                });
            })
        })
    </script>
</body>

</html>